<!DOCTYPE html>
<html>
	<head>
		<title>流程配置一览页</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	<body>
		<fieldset class="scheduler-border" ng-if="showGlobalConf" name="flowConfFieldset">
			<legend style="width: 210px; border-bottom: 0; margin-bottom: 10px;">
				<span>流程配置-（即将被覆盖）</span>
			</legend>
			<div title="全局表单设置 "  style="width:100%;padding:5px;" >
				<div title="全局表单" type="global" bpm-form="overallView.flow.globalForm" mobile-form="overallView.flow.globalMobileForm" ></div>
				<div title="实例表单" type="instance" bpm-form="overallView.flow.instForm"></div>
			</div>
			<table class="table table-bordered" >
		          <tr ng-repeat="bo in overallView.flow.dataModelList">
		          		<th>BO配置</th> <td>{{bo.name}}</td> <td>{{bo.code}}</td>
		          </tr>
			</table>
			
			<table class="table table-bordered" title="节点初始化脚本">
				<thead><th>初始化脚本节点</th><th>打开节点任务时执行脚本</th><th>完成节点任务时执行脚本</th></thead>
		        <tbody>
		          <tr ng-if="!overallView.flow.nodeInitList.length"><td>流程尚未配置节点初始化内容</td></tr>
		          <tr ng-repeat="formInit in overallView.flow.nodeInitList" id="aaformInitScript">
		          		<td>{{formInit.nodeId}}</td>
		          		<td>{{formInit.desc}}</td>
		          		<td>
							 <textarea disabled="disabled" ab-trim ng-model="formInit.beforeShow" rows="2" class="form-control"
							 ng-class="{true: 'same', false: 'nosame'}[getIsSame(overallView,compareOverallView,('overallView.flow.nodeInitList['+this.$index+'].beforeShow'))]"></textarea>
						</td> 
		          		<td>
							 <textarea disabled="disabled" ab-trim ng-model="formInit.whenSave" rows="2" class="form-control"
							  ng-class="{true: 'same', false: 'nosame'}[getIsSame(overallView,compareOverallView,('overallView.flow.nodeInitList['+this.$index+'].beforeShow'))]"></textarea>
		          		</td> 
		          </tr>
		        </tbody>
		   </table>
		</fieldset>
		
		<fieldset class="scheduler-border" ng-repeat="(nodeId,nodeConf) in overallView.nodeMap" ng-if="nodeConf.nodeType !='parallelGateway'" name="{{nodeConf.nodeId}}Fieldset">
			<legend style="width: 320px; border-bottom: 0; margin-bottom: 10px;">
				<div style="text-align: center;">{{nodeConf.nodeName}}一 {{nodeConf.nodeId}}</div>
			</legend>
		  	<div ng-if="nodeConf.nodeType=='userTask' || nodeConf.nodeType=='start' || nodeConf.nodeType=='end'">
				<div title="表单设置 " ab-tip="{position:{my:'bottom center',at:'top center'}}" style="width:100%;padding:5px;" ng-if="showForm">
					   <div title="节点表单" type="node" bpm-form="nodeConf.form" mobile-form="nodeConf.mobileForm" ></div>
				</div>
				<!-- 人员 -->
				<div title="人员配置 " ab-tip="{position:{my:'bottom center',at:'top center'}}" ng-show="showUserConf">
					<table class="table table-bordered">
				        <tbody>
				          <tr ng-if="!nodeConf.userAssign.length"><td>尚未配置人员设置</td></tr>
				          <tr ng-repeat="userConf in nodeConf.userAssign"> 
				          		<td style="width: 200px">{{userConf.description}}</td>
				          		<td><textarea style="max-width: 1100px!important" ab-show-json="false" ng-model="userConf.ruleList" disabled="disabled" class="form-control"
				          		ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'userConf.ruleList['+$index+']')]"></textarea></td> 
				          </tr>
				        </tbody>
				   </table>
			   </div>
			     
		  		<div  title="节点按钮  ——下面仅展示含脚本的按钮（点击按钮编辑脚本）"  style="width:100%;padding:5px;" ng-if="showBtn">
			     	<div> 
			     		 <button ng-repeat="btn in nodeConf.btnList" type="button" class="btn btn-sm btn-success" ng-click="changeShowBtn(nodeConf.btnList)">{{btn.name}}</button>
					   	<table class="table table-bordered" >
					   		<thead> <tr><th>按钮名字</th><th>动作</th><th>前置js脚本</th><th style="width: 120px">后置js脚本</th><th>展示前groovy脚本</th></thead>
					          <tr id="{{nodeConf.nodeId}}nodeBtnScript" ng-repeat="btn in nodeConf.btnList"  ng-show="btn.beforeScript || btn.afterScript || btn.groovyScript || btn.isShow"> 
					          		<td>{{btn.name}}</td><td>{{btn.alias}}</td>
					          		<td><textarea rows="1" ab-trim ng-model="btn.beforeScript" class="form-control" disabled="disabled"
					          					ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'btnList['+$index+'].beforeScript')]"></textarea></td> 
					          		<td><textarea rows="1" ab-trim ng-model="btn.afterScript"  class="form-control" disabled="disabled"
					          					ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'btnList['+$index+'].afterScript')]"></textarea></td>
					          		<td><textarea rows="1" ab-trim ng-model="btn.groovyScript" class="form-control" disabled="disabled"
					          					ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'btnList['+$index+'].groovyScript')]"></textarea></td>
					          </tr>
					   </table>
			  		</div>
		  		</div>
		  	</div>
		  	<!-- 插件  -->
		  	<div ng-repeat="(pluginKey,plugin) in nodeConf.plugins">
		  		<!-- 流程节点前后置脚本 -->
		  	 	<table class="table-form" ng-if="showScript">
			        <tbody>
			          <tr id="{{nodeConf.nodeId}}-nodeScript">  
			          		<td  ab-tip="{position:{my:'bottom center',at:'top center'}}" title="任务创建时脚本" ng-if="nodeConf.nodeType=='userTask'"> 
			          			<textarea ng-model="plugin.nodeScript.taskCreate" ab-trim rows="2" class="form-control"
			          				ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'plugin.nodeScript.taskCreate')]"></textarea>  
			          		</td> 
			          		<td ab-tip="{position:{my:'bottom center',at:'top center'}}" title="任务完成时脚本" ng-if="nodeConf.nodeType=='userTask'"> 
			          			<textarea id="{{nodeConf.nodeId}}" ab-trim ng-model="plugin.nodeScript.taskComplete" rows="2" class="form-control"
			          				ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'plugin.nodeScript.taskComplete')]"></textarea>
			          		</td>
			          		<td ab-tip="{position:{my:'bottom center',at:'top center'}}"  title="流程创建时脚本" ng-if="nodeConf.nodeType=='start'"> 
			          			<textarea ab-trim ng-model="nodeConf.scriptMap.start" rows="2" class="form-control"
			          				ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'nodeConf.scriptMap.start')]"></textarea>  
			          		</td>
			          		<td ab-tip="{position:{my:'bottom center',at:'top center'}}"  title="流程完成时执行脚本"  ng-if="nodeConf.nodeType=='end'"> 
			          			<textarea ab-trim rows="2" ng-model="plugin.nodeScript.end" class="form-control"
			          				ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'plugin.nodeScript.end')]"></textarea>  
			          		</td> 
			          	   <td ab-tip="{position:{my:'bottom center',at:'top center'}}"  title="流程人工结束时执行脚本"  ng-if="nodeConf.nodeType=='end'"> 
			          	   		<textarea ab-trim rows="2" ng-model="plugin.nodeScript.manualend"  class="form-control"
			          	   			ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'plugin.nodeScript.manualend')]"></textarea>
			          	   </td>
			          </tr>
			        </tbody>
			   </table>
		  		 <!-- 跳转脚本 -->
			   <table class="table table-bordered" title="跳转脚本 " ng-if="pluginKey='ruleSkip' && plugin.ruleSkip.length && showNodeSkip">
			        <tbody>
			        	<tr><th>自由跳转脚本描述</th><th>跳转目标节点</th><th>跳转条件脚本</th></tr>
			          <tr ng-repeat="jumpRule in plugin.jumpRules" id="xxnodeSkipScript"> 
			          	<td>{{jumpRule.ruleName}}</td> <td>{{jumpRule.targetNodeDesc}}-{{jumpRule.targetNode}}</td> 
			          	<td><textarea  class="form-control" ab-trim ng-model="jumpRule.script" disabled="disabled"
			          		ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'plugin.jumpRules['+$index+'].script')]"></textarea></td> 
			          </tr>
			        </tbody>
			   </table>
		  	
		  	</div>
		  	
	  		<div ng-if="(nodeConf.nodeType=='exclusiveGateway' || nodeConf.nodeType =='inclusiveGateway') && isShowGateway">
			   	<table class="table table-bordered"  title="网关条件" ab-tip="{position:{my:'bottom center',at:'top center'}}">
			          <tr ng-repeat="(nodeId,script) in nodeConf.gatewayScript" id="xxgatewayScript">
			          	<th>目标节点：{{nodeId}} </th>
			          	<td> <textarea rows="2" ng-model="nodeConf.gatewayScript[nodeId]" class="form-control" disabled="disabled"
			          				ng-class="{true: 'same', false: 'nosame'}[getIsSame(nodeConf,compareOverallView[nodeId],'gatewayScript[nodeId]')]"></textarea></td>
			          </tr>
			   </table>
	  		</div>
	  	</fieldset>
	</body>
</html>
<style>
.nosame{
	    background-color: #ffccbd !important;
}
</style>